package com.byp.java_sport.config.annotation;

import org.springframework.core.annotation.AliasFor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 自定义注解，作用于Controller
 */
@RestController
@RequestMapping
@Target(ElementType.TYPE)//只能作用于类上
@Retention(RetentionPolicy.RUNTIME)//运行时作用
public @interface RestControllerMapping {
    //从requestmapping那边拿两个类上面的参数
    @AliasFor("path")
    String[] value() default {};

    @AliasFor("value")
    String[] path() default {};
}
